package com.mxprojects.gui
{
	import flash.display.MovieClip;

	public class LoadingAnimation extends MovieClip
	{
		private static const Y_OFFSET:int = 300;
		
		public function LoadingAnimation(){
			enabled = false;
		}
		
		override public function set enabled(isEnabled:Boolean):void {
			if(isEnabled){
				visible = true;
				gotoAndPlay(2);
			}else{
				gotoAndStop(1);
				visible = false;
			}
		}
		
		public function resize():void {
			if(stage != null){
				x = stage.stageWidth/2 - width/2;
				y = Y_OFFSET;
			}
		} 
	}
}